﻿<ResourceDictionary
	xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" 
	xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:Microsoft_Windows_Themes="clr-namespace:Microsoft.Windows.Themes;assembly=PresentationFramework.Classic">
	<!-- Resource dictionary entries should be defined here. -->
	<Style x:Key="TabControlSetup" TargetType="{x:Type TabControl}">
 <Setter Property="Padding" Value="7"/>
        <Setter Property="BorderThickness" Value="1"/>
        <Setter Property="Background" Value="#FFB2B6C1"/>
        <Setter Property="HorizontalContentAlignment" Value="Center"/>
        <Setter Property="VerticalContentAlignment" Value="Center"/>
        <Setter Property="TabStripPlacement" Value="Top"/>
        <Setter Property="ContextMenu" Value="{Binding SelectedTabItem.ContextMenu, RelativeSource={RelativeSource Self}}"/>
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="{x:Type TabControl}">
                    <Grid ClipToBounds="true" SnapsToDevicePixels="true" KeyboardNavigation.TabNavigation="Local">
                        <Grid.RowDefinitions>
                            <RowDefinition x:Name="RowDefinition0" Height="Auto"/>
                            <RowDefinition x:Name="RowDefinition1" Height="*"/>
                        </Grid.RowDefinitions>
                        <Grid.ColumnDefinitions>
                            <ColumnDefinition x:Name="ColumnDefinition0"/>
                            <ColumnDefinition x:Name="ColumnDefinition1" Width="0"/>
                        </Grid.ColumnDefinitions>
                        <TabPanel x:Name="HeaderPanel" Margin="0,0,0,-1.75" Height="Auto" IsItemsHost="true" Panel.ZIndex="1" Grid.Column="0" Grid.Row="0" KeyboardNavigation.TabIndex="1" VerticalAlignment="Bottom"/>
                        <Border x:Name="Border" BorderBrush="#000000" BorderThickness="1,1,1,1" Margin="0,0,1,1" Grid.Row="1" >
                        	<Border Background="#000000">
                        		<!--<ContentPresenter Margin="{TemplateBinding Padding}" x:Name="PART_SelectedContentHost" SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}" ContentSource="SelectedContent"/>
                                    ContextMenu="{Binding SelectedItem.ContextMenu, RelativeSource={RelativeSource TemplatedParent}}"-->
                        		<Grid x:Name="PART_SelectedContentHost" Margin="{TemplateBinding Padding}" SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}" >
                        			<Grid.Background>
                        				<LinearGradientBrush EndPoint="0.5,1" StartPoint="0.5,0">
                        					<GradientStop Color="#00FFFFFF" Offset="0"/>
                        					<GradientStop Color="#FFFFFFFF" Offset="1"/>
                        				</LinearGradientBrush>
                        			</Grid.Background>
                        		</Grid>
                        	</Border>
                        </Border>
                    </Grid>
                    <ControlTemplate.Triggers>
                        <Trigger Property="IsEnabled" Value="False">
                            <Setter Property="Background" Value="#41894e"/>
                            <Setter Property="BorderBrush" Value="#41894e" TargetName="Border"/>
                        </Trigger>
                    </ControlTemplate.Triggers>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
        <Setter Property="Foreground">
        	<Setter.Value>
        		<LinearGradientBrush EndPoint="0.5,1" StartPoint="0.5,0">
        			<GradientStop Color="#FF000000" Offset="0"/>
        			<GradientStop Color="#FFBE0000" Offset="1"/>
        		</LinearGradientBrush>
        	</Setter.Value>
        </Setter>
    </Style>
	<Style TargetType="{x:Type TabItem}">
        <Setter Property="FocusVisualStyle" Value="{x:Null}"/>
        <Setter Property="Padding" Value="12,0,12,0"/>
        <Setter Property="BorderThickness" Value="1,1,1,0"/>
        <Setter Property="BorderBrush" Value="#000000"/>
        <Setter Property="Foreground" Value="#CCCCCC"/>
        <Setter Property="HorizontalContentAlignment" Value="Stretch"/>
        <Setter Property="VerticalContentAlignment" Value="Center"/>
        <Setter Property="IsTabStop" Value="True"/>
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="{x:Type TabItem}">
                    <Border SnapsToDevicePixels="true" Height="21">
                        <Grid Margin="0,0,1,-2">
                            <Grid x:Name="Transform">
                                <Border x:Name="Bd" Margin="0,2.5,0,1" BorderBrush="#FFB2B6C1" BorderThickness="1" CornerRadius="3,3,0,0">
                              		<Border.Background>
										<LinearGradientBrush EndPoint="0.5,1" StartPoint="0.5,0">
											<GradientStop Color="#FF336699" Offset="0"/>
											<GradientStop Color="#FF11273C" Offset="1"/>
										</LinearGradientBrush>
									</Border.Background>
								</Border>
								<Border x:Name="HighlightBorder" VerticalAlignment="Bottom" Height="1" BorderThickness="1,1,1,0" CornerRadius="3,3,0,0"/>
                            </Grid>
                            <Border Padding="{TemplateBinding Padding}" VerticalAlignment="Bottom">
                                <DockPanel VerticalAlignment="Center" x:Name="PART_Info">
                                    <Grid>
                                        <Grid.ColumnDefinitions>
                                            <ColumnDefinition Width="*"/>
                                            <ColumnDefinition Width="Auto"/>
                                        </Grid.ColumnDefinitions>
                                        <ContentPresenter Grid.Column="0" x:Name="PART_Content" Margin="0,0,0,2.5" HorizontalAlignment="{Binding Path=HorizontalContentAlignment, RelativeSource={RelativeSource AncestorType={x:Type ItemsControl}}}" VerticalAlignment="{Binding Path=VerticalContentAlignment, RelativeSource={RelativeSource AncestorType={x:Type ItemsControl}}}" SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}" ContentSource="Header" RecognizesAccessKey="True" Style="{DynamicResource ControlFont}"/>
                                    </Grid>
                                </DockPanel>
                            </Border>
                        </Grid>
                    </Border>
                    <ControlTemplate.Triggers>
                        <Trigger Property="IsMouseOver" Value="true">
                            <Setter Property="Background" Value="#41894e" TargetName="Bd"/>
                        </Trigger>
                        <Trigger Property="IsSelected" Value="true">
                            <Setter Property="Panel.ZIndex" Value="1"/>
                            <Setter Property="Height" Value="20"/>
                            <Setter Property="Margin" Value="0,0,0,2" TargetName="PART_Info"/>
                            <Setter Property="BorderBrush" Value="#FFFFFF" TargetName="HighlightBorder"/>
                            <Setter Property="Background" Value="#FFFFFF" TargetName="HighlightBorder"/>
                            <Setter Property="Background" Value="#11273c" TargetName="Bd"/>
                            <Setter Property="BorderBrush" Value="#FFFFFF" />
                            <Setter Property="Background" Value="#CCCCCC" />
                            <Setter Property="Margin" Value="0,0,0,10" />
                            <Setter Property="Margin" Value="0,0,-11,-2" />
                        </Trigger>
                        <MultiTrigger>
                            <MultiTrigger.Conditions>
                                <Condition Property="IsMouseOver" Value="True" />        
                                <Condition Property="IsSelected" Value="True"/>
                            </MultiTrigger.Conditions>
                            <Setter Property="BorderBrush" Value="#41894e" />
                            <Setter Property="Background" Value="#41894e" />
                        </MultiTrigger>
                        <Trigger Property="IsFocused" Value="True">
                            <Setter Property="BorderBrush" Value="#41894e" TargetName="Bd"/>
                        </Trigger>
                        <MultiTrigger>
                            <MultiTrigger.Conditions>
                                <Condition Property="IsSelected" Value="True"/>
                                <Condition Property="IsEnabled" Value="True"/>
                            </MultiTrigger.Conditions>
                            <Setter Property="Margin" Value="0,0,0,0" TargetName="Bd"/>
                        </MultiTrigger>
                        <MultiTrigger>
                            <MultiTrigger.Conditions>
                                <Condition Property="IsEnabled" Value="False"/>
                            </MultiTrigger.Conditions>
                            <Setter Property="Foreground" Value="{DynamicResource BrushTabControlItemForegroundDisabled}"/>
                            <Setter Property="Background" TargetName="Bd" Value="{DynamicResource BrushTabControlItemBackgroundDisabled}"/>
                            <Setter Property="BorderBrush" TargetName="Bd" Value="{DynamicResource BrushTabControlTabItemDisabledBorderBrush}"/>
                        </MultiTrigger>
                        <MultiTrigger>
                            <MultiTrigger.Conditions>
                                <Condition Property="IsEnabled" Value="False"/>
                                <Condition Property="IsSelected" Value="True"/>
                            </MultiTrigger.Conditions>
                            <!--<Setter Property="Margin" Value="-2,0,0,0"/>-->
                        </MultiTrigger>
                    </ControlTemplate.Triggers>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>
	</ResourceDictionary>